//
//  AWFileChatMessage.h
//  AtWork2
//
//  Created by lucas on 15/5/28.
//  Copyright (c) 2015年 Foreveross. All rights reserved.
//

#import "AWChatMessage.h"

/**
 *  文件发送下载状态。
 */
typedef NS_ENUM(NSUInteger, AWFileChatMessageStatus) {
    
    /** 发送中 */
    AWFileChatMessageStatusSenderSending         = 0,
    
    /** 发送失败 */
    AWFileChatMessageStatusSenderFault           = 1,
    
    /** 发送成功 */
    AWFileChatMessageStatusSenderSent            = 2,
    
    /** 接收 已下载 */
    AWFileChatMessageStatusReceiverDownloaded    = 10,
    
    /** 接收 未下载 */
    AWFileChatMessageStatusReceiverUnDownloaded  = 11,
    
    /** 接收中 */
    AWFileChatMessageStatusReceiverDownloading   = 12,
    
    /** 已取消 */
    AWFileChatMessageStatusReceiverInvalid       = 13
};

/**
 *  文件消息
 */
@interface AWFileChatMessage : AWChatMessage

@property (nonatomic, copy, readonly) NSString *name;

@property (nonatomic, assign, readonly) NSUInteger size;

/** 过期时间(毫秒值)*/
@property (nonatomic, assign) UInt64 expireTime;

/** 当文件类型是图片的时候会有一个缩略图 */
@property (nonatomic, strong) NSData *thumbnail;

@property (nonatomic, copy) NSString *mediaId;

@property (nonatomic, assign) AWFileChatMessageStatus fileStatus;

@property (nonatomic,assign) BOOL cancel;

/** 根据文件的状态获取相应的描述 */
@property (nonatomic, copy, readonly) NSString *fileStatusDescription;

/** 进度条 */
@property (nonatomic, assign, readwrite) float progress;

/** 文件路径 */
@property (nonatomic, copy, readwrite) NSString *path;

+ (instancetype)fileChatMessageWithFrom:(NSString *)from
                                     to:(NSString *)to
                                   size:(NSUInteger)size
                                   name:(NSString *)name
                           chatDestType:(AWChatDestType)chatDestType;

+ (instancetype)initServceAppWithFrom:(NSString *)from
                                   to:(NSString *)to
                                 size:(NSUInteger)size
                                 name:(NSString *)name;

@end
